<?php
include("ClassLoader\loader.php");
    $loader = new Loader();
    $loader->load();
$client = new nusoap_client("http://localhost/buzzPulse/m/");
 
$error = $client->getError();
if ($error) {
    echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
}
 
$filter = array("dateFrom" => '21-12-2013', "dateTo" => '', "language" => 0, 
    "location" => 0, "platform" => 0,  "tag" => 0, "sentiment" => 0, 
    "gender" => 0, "reach" => 0);
//$result = $client->call("getTrendlineData", array("filter" => $filter));
$result = $client->call("getTrendlineData", array("filter" => $filter));

if ($client->fault) {
    echo "<h2>Fault</h2><pre>";
    print_r($result);
    echo "</pre>";
}
else {
    $error = $client->getError();
    if ($error) {
        echo "<h2>Error</h2><pre>" . $error . "</pre>";
    }
    else {
        echo "<h2>Result</h2><pre>";
        print_r($result);
        echo "</pre>";
    }
}

$stream = Stream::withData(1, "iPad", 2, 'iPad | "iPad 1" | "iPad 2" | "iPad 3" | "iPad 4" | "new iPad"', 2, 704, 0, NULL, 1);
var_dump($stream);
print_r(bpServer::saveStream($stream));